{% extends "comics/base.html" %}
{% load i18n thumbnail comments %}

{% block title %}{{webcomic.title|capfirst}}{% endblock title %}

{# control panel for comic book owner #}
{% block more-options %}
	{% if owner %}
    - <a href='{% url comics.webcomic.act webcomic.slug,"add" %}'>{% trans "Add new comic"%}</a>
	    {% if strip %}
	    - <a href='{% url comics.strip.act webcomic.slug,strip.id,"edit" %}'>{% trans "Configure this Strip"%}</a>
	    - <a href='{% url comics.strip.act webcomic.slug,strip.id,"del" %}'>{% trans "Remove this Strip"%}</a>
	    - <a href='{% url comics.webcomic.act webcomic.slug,"configure" %}'>{% trans "Configure WebComic"%}</a>
	    {% endif %}
	{% endif %}
{% endblock more-options %}

{% block body %}

{# if any message was created, do this... #}
{% if messages %}
<ul id="temp_messages">
{% for message in messages %}
    <li>{{message}}</li>
{% endfor %}
</ul>
{% endif %}

{% if webcomic.image %}
<div class="comic-headerImage">	
    <a href="{% url comics.webcomic webcomic.slug %}">
        <img alt="Webcomic" class="comic-headerImage" src="{{ webcomic.image.url }}"></img>
    </a>
</div>
{% endif %}

{# comics bar. All the comics avaiable are showned here #}
{% if webcomic.count %}
<div class="clearfix shelf bar">
	{% for webcomic in webcomics %}		
		<a class="url comic" href="{{webcomic.link}}">
			<img alt="Imagem em Miniatura" src='{{webcomic.thumbnail|thumbnail:"60x80"}}'></img></a>
	{% endfor %}
</div>
{% endif %}

{% if strip %}
    
    {% include "comics/includes/simple_forward_bar.html" %}
    {# including the comic image  #}
    <div>
        <div class="clear" style="text-align: center;">
            <a {% if strip.next %} href="{{strip.next.link}}" {% else %} href="." {% endif %}>
                <img title="{{strip.name}}" alt="Strip {{strip.name}}" id="comic_image" src="{{strip.image.url}}"
                 width="{{image_width}}"></img></a>
        </div>
    </div>
    {% include "comics/includes/simple_forward_bar.html" %}
    
{% else %}
<div class="notice">{% trans "There are no comic strips avaiable at the moment"%}.</div>
{% endif %}

{% if strip and strip.enable_comments %}

{% get_comment_form for strip as form %}
<fieldset>
	<legend>{% trans "Comment this Strip"%}</legend>
	{% render_comment_form for strip %}
</fieldset>

{% get_comment_list for strip as comment_list %}

{% for comment in comment_list reversed %}
<div class="clear">
	<div class="box">
		{% if comment.user_url %}<a href='{{comment.user_url}}'>WebSite</a> - {% endif %}<strong>{{comment.user_name}} in {{comment.submit_date|date:"d/M/Y, G:i"}}</strong>
		<hr />
		<p>{{comment.comment|linebreaks}}</p>
	</div>
</div>
{% endfor %}

{% endif %}

{% endblock body %}